<?php namespace App\Console\Commands;

use HiCommon\Service\AutoScheduleService;
use HiCommon\Service\LogService;
use Illuminate\Console\Command;

class RepairServiceOrderConfirm extends Command
{

    protected $name = 'confirm_order_repair';

    protected $description = '略略略'; // 命令描述，没什么用

    /**
     * 维修保养商户端确认完成后三天后，更新订单为用户确认已完成
     */
    public function handle()
    {
        try {
            shiwu_start();
            $res = AutoScheduleService::confirm_order_repair();
            shiwu_end($res);
            if($res['state'] != 0){
                LogService::wright_log_for_auto_schedule('维修保养商户端确认完成后三天后，更新订单为用户确认已完成',$res,'error');
            }
        } catch (\Exception $exception) {
            $res = ['state' => 1, 'msg' => '失败', 'data' => [], 'error' => $exception->getMessage()];
            LogService::wright_log_for_auto_schedule('维修保养商户端确认完成后三天后，更新订单为用户确认已完成',$res,'error');
        }

    }

}